package learningThread.api.stopApi.returnStop;

public class MyThread extends Thread{

    @Override
    public void run() {

        while (true) {
            if (this.isInterrupted()) {
                System.out.println("线程停止");
                return ;
            }
            try {
                sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("循环执行");
        }

    }
}
